import request from '@/utils/request'

export const login = (obj) => {
    return request.post('/login', {
      
        account:obj.account,
        password:obj.password

       
    })
}

export const reg = (obj) => {
    return request.post('/reg', {

        account: obj.account,
        password: obj.password


    })
}

export const getProfile = (uid) => {
    return request.get('/profile', {

        params:{
            uid:uid
        }

    })
}

export const edify = (obj) => {
   
    const formData = new FormData();
    formData.append('uid', obj.uid);       // 用户 ID
    formData.append('avatar', obj.avatar); // 文件
    formData.append('userName', obj.userName); // 用户名

    return request.post('/profile', formData, {
       
    });
}